package threecard.android.room;

import android.content.Context;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

public class Room extends LinearLayout{
	private int playerNumber;
	private String roomName;
	private RoomButton button;
	private TextView tv;
	
	public Room(Context context, String name, int numberOfPlayer){
		super(context);
		roomName = name;
		playerNumber = numberOfPlayer;
		
		button = new RoomButton(context);
		button.setImageResource(threecard.android.R.drawable.room);
		button.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Log.w("onClick", "Clicked on image of room " + roomName);
				
			}
		});
		this.addView(button);

		tv = new TextView(context);
		tv.setText(name + " " + numberOfPlayer);
		this.addView(tv);

	}


	public int getPlayerNumber() {
		return playerNumber;
	}

	public void setPlayerNumber(int playerNumber) {
		this.playerNumber = playerNumber;
	}

	public String getRoomName() {
		return roomName;
	}

	public void setRoomName(String roomName) {
		this.roomName = roomName;
	}


	public int getID() {
		return button.getId();
	}

}
